package Wormish.agiletre.se;

import android.util.Log;

public class InputState
{
	public boolean IsKeyLeftPressed = false;
	public boolean IsKeyRightPressed = false;
	public boolean IsKeyUpPressed = false;
	public boolean IsKeyRopePressed = false;
	public boolean IsKeyShootPressed = false;
	public boolean IsKeyChangeWeaponPressed = false;
	
	public static final int UP = 0;
	public static final int LEFT = 1;
	public static final int ROPE = 2;
	public static final int RIGHT = 3;
	public static final int SHOOT = 4;
	public static final int CHANGEWEAPON = 5;
	
	public void HandleKeyUpPress(int keyCode)
	{
    	if(keyCode == UP) //Up Key
    	{
    		IsKeyUpPressed = false;
    	}
    	else if(keyCode == LEFT) //Left Key
    	{
    		IsKeyLeftPressed = false;
    	}
    	else if(keyCode == ROPE)
    	{
    		IsKeyRopePressed = false;
    	}
    	else if(keyCode == RIGHT)
    	{
    		IsKeyRightPressed = false;
    	}
    	else if(keyCode == SHOOT){ //Shot key
    		IsKeyShootPressed = false;
    	}
    	else if(keyCode == CHANGEWEAPON){ //Change weapon key
    		IsKeyChangeWeaponPressed = false;
    	}
	}
	
	public void HandleKeyDownPress(int keyCode)
	{
    	if(keyCode == UP) //Up Key
    	{
    		IsKeyUpPressed = true;
    	}
    	else if(keyCode == LEFT) //Left Key
    	{
    		IsKeyLeftPressed = true;
    	}
    	else if(keyCode == ROPE)
    	{
    		IsKeyRopePressed = true;
    	}
    	else if(keyCode == RIGHT)
    	{
    		IsKeyRightPressed = true;
    	}
    	else if(keyCode == SHOOT){ //Shot key
    		IsKeyShootPressed = true;
    	}
    	else if(keyCode == CHANGEWEAPON){ //Change weapon key
    		IsKeyChangeWeaponPressed = true;
    	}
	}
}
